Introduction
In this lab you are going to learn how to connect to use Azure Lab Service, use Hyper-V to create a Linux virtual machines and you are going to have an introduction to Linux.
Connect to Azure Lab Services
- Log into your email. You will have received an email from Microsoft Azure about registering for the CO4509 lab.
- Click the 'Register for the lab' link. It will take you to a web site where you will be registered the for the lab.
- If the virutal machine isn't already started click start. This will take a few minutes if the Azure Lab services machine isn't already running.
- Once the Azure Lab services virtual machine is running click on the three dots and then click reset password.
- Set a new password.
- Click the icon of a computer. This downloads the connection file. Once it has downloaded click on it to connect your Azure Lab Services virtual machine.
- Click through any popups. And enter your password if prompted.
Setup Windows
- When you first connect you will have to finish the installation of Windows. Click Accept
- Click yes.
Installing Linux in Hyper-V
- In the Windows search bar type hyper-v. Once Hyper-V Manager is shown click on it.
- Once Hyper-V has loaded click on the Hyper-V Manager. In my case this was ML-REFVM-435496.
- Select Action, then Quick Create.
- Select Ubuntu 18.04 LTS and click Create Virtual Machine.
- Once the Virtual machine has been created click connect
- You now need to finish the Linux installation. Select English and click Continue.
- Select the appropiate keyboard map. The lab uses English (UK) and English (UK).
- Set your location as London, this sets the timezone for the computer.
- Fill in your details to create a new account on the Linux computer. For the password I used Pa55word. You should make sure you set a password that you can remember.
- Once the installation has finished click the nine dots at the bottom left and type in terminal.
- You should be left with a terminal as shown below. This will let you enter various Unix commands.
Learning Linux
- Many of the commands in Linux are very terse and initially seem to be not particularly intuitive.
You might need some time to become accustomed to them and perhaps a little longer still to appreciate their great power.
One of the most useful commands is man. It gives the man(ual) pages for specified commands.
- pwd
- ls
- cd
- mkdir
- cp
- mv
- rm
- rmdir
- cat
- more
- less
- df
- du
- wc
- sort
- diff
- find
- whereis
- nslookup
- man
Look at the man pages for these commands by typing man then the command in a terminal window e.g. man pwd
(use the space bar to scroll down, q to quit). Make brief notes. Explain the difference between more and less
- What is your current working directory?
- Create a new directory and change to it.
- Create another directory called Practice and change to this new directory.
- Use an editor to create a text file of about 20 lines in this directory.
- What happens if you type the following?
cd ..
- Keep typing the above command and check the name of the directory each time.
- Change to your home directory.
What does ls -l show?
What does ls -al show?
- List your text file to the screen.
- Sort the file and list it to the screen.
- Sort the file and write the output to a new file.
- Move the sorted file to your home directory.
- Copy the file to your Practice directory.
- What happens if you type the following?
rm -i *
- What would happen if you typed the following (don't do it)?
rm *
- What does the following show?
df
- Type cd /. Where are you?
- Type ls. What do you see?
- What is in /bin?
- What is in /etc?
- What is in /dev?
- What does the command grep do?
- What does the command chmod do?
- Change the protections on the file that you created so that no-one else can access it (except the root superuser who can bypass all protections).
- What does the command apropos do?
- Find out how you would list the differences between two similar files. Try it.
- What does the command firefox do?
- What is the name of the directory containing your configuration files for firefox?
- What command, if you typed it accidentally as the root superuser, would delete the entire operating system?
- What happens if you type the following?
ls -l | wc
- What is the function of the vertical line $|$ in the above command?